package com.hhf.springboot.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hhf.springboot.common.DataGroupByDateDTO;
import com.hhf.springboot.model.dto.serviceProject.ServiceProjectQueryRequest;
import com.hhf.springboot.model.entity.ServiceProject;
import com.hhf.springboot.model.vo.ServiceProjectVO;

import javax.servlet.http.HttpServletRequest;

import java.util.Date;
import java.util.List;

/**
 * 服务项目信息服务
 *
 * @author hhf
 * @from <a href="https://gitee.com/hanhuaifei/projects">我的gitee</a>
 * @Date 2024/9/26
 */
public interface ServiceProjectService extends IService<ServiceProject> {

    /**
     * 校验数据
     *
     * @param serviceProject
     * @param add 对创建的数据进行校验
     */
    void validServiceProject(ServiceProject serviceProject, boolean add);

    /**
     * 获取查询条件
     *
     * @param serviceProjectQueryRequest
     * @return
     */
    QueryWrapper<ServiceProject> getQueryWrapper(ServiceProjectQueryRequest serviceProjectQueryRequest);
    
    /**
     * 获取服务项目信息封装
     *
     * @param serviceProject
     * @param request
     * @return
     */
    ServiceProjectVO getServiceProjectVO(ServiceProject serviceProject, HttpServletRequest request);

    /**
     * 分页获取服务项目信息封装
     *
     * @param serviceProjectPage
     * @param request
     * @return
     */
    Page<ServiceProjectVO> getServiceProjectVOPage(Page<ServiceProject> serviceProjectPage, HttpServletRequest request);

    /**
    * 分按日期分组查询服务项目信息新增数量
    *
    * @param beginDate 开始时间
    * @param endDate   结束时间
    * @return
    */
    List<DataGroupByDateDTO> countByDay(Date beginDate, Date endDate);

    /**
     * 项目浏览
     * @param serviceProjectId
     * @return
     */
    long doClick(Long serviceProjectId);
}
